<extend name="Public:base"/>


<block name="left">
    <ul>
        <li><a href="{:U('Fen/index')}">分销设置</a></li>
        <li><a href="{:U('Fen/vip_set')}">会员升级设置</a></li>
        <li><a href="{:U('Fen/shang')}">分销商管理</a></li>
        <li><a href="{:U('Fen/ti')}">佣金提现管理</a></li>
    </ul>
</block>

<block name="right">
	<form action="{:U('Fen/set_distribution')}" method="POST">
	<foreach name="data" item="data">
		<label>{$data.d_key}分销比例(%)</label>
	    <input type="text" name="{$data.d_key}" id="{$data.d_key}" value="{$data.d_value}"><br>
	</foreach>
		<input type="submit" name="submit">
		<input type="reset" name="reset">
	</form>
	<script type="text/javascript">
		function check_form(){

			var err_msg = '';
			
			for (var i = 1; i < 3; i++) {
				var tag_id = 'level'+i;
				var tag = document.getElementById(tag_id);

				if (isNaN(tag.value) || tag.value == '') {
					err_msg += tag_id+'参数填写错误\n';
				}
			}

			for (var i = 1; i < 9; i++) {
				var tag_id = 'vip'+i;
				var tag = document.getElementById(tag_id);

				if (isNaN(tag.value) || tag.value == '') {
					err_msg += tag_id+'参数填写错误\n';
				}
			}

			if (err_msg != '') {
				alert(err_msg);
				return false;
			}

			return true;
		}
	</script>
</block>
	